std::forward_list::splice_after

From Cppreference

Jump to: navigation, search
void splice_after(const_iterator pos, forward_list& other);
(1) (C++11 feature)
void splice_after(const_iterator pos, forward_list&& other);
(1) (C++11 feature)
void splice_after(const_iterator pos, forward_list& other, const_iterator it);
(2) (C++11 feature)
void splice_after(const_iterator pos, forward_list&& other, const_iterator it);
(2) (C++11 feature)
void splice_after(const_iterator pos, forward_list& other,
                  const_iterator first, const_iterator last);
(3) (C++11 feature)
void splice_after(const_iterator pos, forward_list&& other,
                  const_iterator first, const_iterator last);
(3) (C++11 feature)

Moves elements from another forward_list to *this.

No elements are copied. The behavior is undefined if: get_allocator() != other.get_allocator(), or this == &other. No iterators or references become invalidated, the iterators to moved elements now refer into *this, not into other.

1) Moves all elements from other into *this. The elements are inserted after the element pointed to by pos. The container other becomes empty after the operation.

2) Moves the element pointed to by it from other into *this. The element is inserted after the element pointed to by pos.

3) Moves the elements in the range [first, last) from other into *this. The elements are after before the element pointed to by pos.

Contents

[edit] Parameters

pos - element after which the content will be inserted
other - another container to move the content from
it - the element to move from other to *this
first, last - the range of elements to move from other to *this

[edit] Return value

(none)

[edit] Example

[edit] Complexity

constant

[edit] See also

Template:cpp/container/dcl list remove if
merge
merges two sorted lists
(public member function)
remove
remove_if
removes elements satisfying specific criteria
(public member function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages